﻿
using CSharpLibs.Annotations;

namespace System.Xml
{
	[Builtin]
	public class XmlReader : Object, IDisposable
	{
		private System.IO.TextReader rrs;

		private XmlReader()
		{ ;}

		public void Close()
		{
			if(this.rrs != null)
			{
				this.rrs.Close();
				this.rrs = null;
			}
		}

		public bool get_IsEmptyElement()
		{ return rrs.Peek() == 0; }

		public String get_Name()
		{ return rrs.ReadLine(); }

		public static XmlReader Create(System.IO.TextReader input, XmlReaderSettings settings)
		{
			XmlReader res = new XmlReader();
			res.rrs = input;
			return res;
		}

		public void Dispose()
		{ this.Close(); }

		public String GetAttribute(String name)
		{ return this.rrs.ReadLine(); }

		public bool IsStartElement()
		{ return rrs.Peek() == 1; }

		public bool IsStartElement(String name)
		{ return this.rrs.ReadLine().Equals(name); }

		public String ReadContentAsString()
		{ return this.rrs.ReadLine(); }

		public void ReadEndElement()
		{ this.rrs.Read(); }

		public void ReadStartElement()
		{ this.rrs.Read(); }

		public void ReadStartElement(String name)
		{ this.rrs.Read(); }

		public String ReadString()
		{ return this.rrs.ReadLine(); }
	}
}
